package tests;

import com.neuronrobotics.sdk.dyio.DyIO;
import com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel;
import com.neuronrobotics.sdk.dyio.peripherals.ServoChannel;
import com.neuronrobotics.sdk.ui.ConnectionDialog;
public class play {
	public static void main(String[] args) throws InterruptedException {
		DyIO dyio=new DyIO();
		if (!ConnectionDialog.getBowlerDevice(dyio)){
			System.exit(1);
		}
		//AnalogInputChannel ir_right = new AnalogInputChannel (dyio.getChannel(10)); //  right 
		//AnalogInputChannel ir_left = new AnalogInputChannel (dyio.getChannel(11)); // left
	   //AnalogInputChannel us_left = new AnalogInputChannel (dyio.getChannel(9)); // left 
		AnalogInputChannel us_right = new AnalogInputChannel (dyio.getChannel(8)); // right
		ServoChannel srv = new ServoChannel (dyio.getChannel(12));
		ServoChannel srv1 = new ServoChannel (dyio.getChannel(13));

		
		for(int i = 1; i <=51; i++)
		{
			srv.SetPosition(128, 1);
			srv1.SetPosition(128, 1);
		System.out.println(us_right.getVoltage() );//+"	"+ us_right.getVoltage());//left and right
		Thread.sleep(10);
		}

		
	dyio.disconnect();
	System.exit(0);
	}
}